<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       <title>添加组织机构信息</title>
	<meta name="renderer" content="webkit">	
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
	<meta name="apple-mobile-web-app-status-bar-style" content="black">	
	<meta name="apple-mobile-web-app-capable" content="yes">	
	<meta name="format-detection" content="telephone=no">	
	<link rel="stylesheet" type="text/css" href="/bsc/static/common/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="/bsc/static/common/bootstrap/css/bootstrap.css" media="all">
	<link rel="stylesheet" type="text/css" href="/bsc/static/common/global.css" media="all">
	<link rel="stylesheet" type="text/css" href="/bsc/static/css/personal.css" media="all">
</head>
<body class="childrenBody">
	<form class="layui-form" id="for">
		<div class="layui-form-item">
					<label class="layui-form-label">
					<font color="red" size="4">*</font>&nbsp;
					机构名称</label>
					<div class="layui-input-block">
						<input type="text" name="dept_name"  class="layui-input newsName" type="text" lay-verify="required" placeholder="请输入机构名称">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">
					<font color="red" size="4">*</font>&nbsp;
					机构代码</label>
					<div class="layui-input-block">
						<input type="text" name="dept_code"  class="layui-input newsName" type="text" lay-verify="required" placeholder="请输入机构代码">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">
					<font color="red" size="4">*</font>&nbsp;
					联系方式</label>
					<div class="layui-input-block">
						<input type="text" name="phone"  class="layui-input newsName" type="text" lay-verify="required" placeholder="请输入联系方式">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">
					<font color="red" size="4">*</font>&nbsp;
					主要负责人</label>
					<div class="layui-input-block">
						<input type="text" name="manager"  class="layui-input newsName" type="text" lay-verify="required" placeholder="请输入负责人姓名">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">
					<font color="red" size="4">*</font>&nbsp;
					上级机构</label>
					<div class="layui-input-block">
						<select name="dept" id="dept"  lay-filter="aihao">
						<c:forEach items="${dept }" var="d">
							<option value="${d.cascade_id }">${d.dept_name }</option>
					    </c:forEach>
						</select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">地址</label>
					<div class="layui-input-block">
						<input type="text" name="address" class="layui-input newsName" type="text" l placeholder="请输入地址">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">传真</label>
					<div class="layui-input-block">
						<input type="text" name="fax"  class="layui-input newsName" type="text"  placeholder="请输入传真">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">备注</label>
					<div class="layui-input-block">
						<textarea  value="" class="layui-textarea" name="remark"></textarea>
					</div>
				</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn" lay-submit="" lay-filter="addNews">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		    </div>
		</div>
	</form>
<script type="text/javascript" src="/bsc/static/common/layui/layui.js"></script>
<script>
  	layui.use(['form','layer','jquery','layedit','laydate'],function(){
	var form = layui.form(),
		layer = parent.layer === undefined ? layui.layer : parent.layer,
		laypage = layui.laypage,
		layedit = layui.layedit,
		laydate = layui.laydate,
		$ = layui.jquery;

 	form.on("submit(addNews)",function(data){
 		var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
            	 setTimeout(function(){
            		 $.ajax({
            	            type: "post",
            	            url: "/bsc/systemdept/save",
            	            data:$("#for").serialize(),
            	            success: function(data){
			                    top.layer.close(index);
			         			top.layer.msg("添加成功！");
			          			layer.closeAll("iframe");
			         	 		//刷新父页面
			         	 		parent.parent.location.reload();
            	            }
            	    });  
                 },2000);
          		return false;
    	});
});
</script>

</body>
</html>